package com.dkm.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import com.dkm.util.PoiHandler;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(value = { "hibernateLazyInitializer"})//json解析忽略为空的对象属性
@Entity
@Table(name = "student")
public class Student {

	@Id
	@PoiHandler(excelHeader = "编号",excelIgnore = true)//poi解析忽略属性
	private String sid;
	@PoiHandler(excelHeader = "姓名")//poi表头列名设置
	private String sname;
	@PoiHandler(excelHeader = "年龄")
	private Integer age;
	@PoiHandler(excelHeader = "性别")
	private String sex;
	@PoiHandler(excelHeader = "电话")
	private String phone;
	@PoiHandler(excelHeader = "学历")
	private String education_background;
	@PoiHandler(excelHeader = "个人状态")
	private String status;
	@PoiHandler(excelHeader = "来源渠道")
	private String source_way;
	@PoiHandler(excelHeader = "来源关键词")
	private String source_keyword;
	@PoiHandler(excelHeader = "地址")
	private String address;
	@PoiHandler(excelHeader = "QQ")
	private String qq;
	@PoiHandler(excelHeader = "微信")
	private String weixin;
	@PoiHandler(excelHeader = "备注")
	private String remark;
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@PoiHandler(excelHeader = "创建时间")
	private Date create_time;
	@PoiHandler(excelHeader = "课程方向")
	private String course_direction;
	@PoiHandler(excelHeader = "是否回访")
	private String is_return_visit;
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@PoiHandler(excelHeader = "首次回访时间")
	private Date first_return_visit_time;
	@PoiHandler(excelHeader = "是否上门")
	private String is_visit;
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@PoiHandler(excelHeader = "上门时间")
	private Date visit_time;
	@PoiHandler(excelHeader = "是否付款")
	private String is_payment;
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@PoiHandler(excelHeader = "付款时间")
	private Date payment_time;
	@PoiHandler(excelHeader = "付款金额")
	private Double payment_amount;
	@PoiHandler(excelHeader = "是否退费")
	private String is_return_money;
	@PoiHandler(excelHeader = "咨询师备注")
	private String consultant_remark;
	@PoiHandler(excelHeader = "学生关注")
	private String stattention;
	@PoiHandler(excelHeader = "录入人姓名")
	private String entering_people_name;
	@PoiHandler(excelHeader = "退费原因")
	private String return_money_reason;
	@PoiHandler(excelHeader = "预付定金")
	private Double advance_money;
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@PoiHandler(excelHeader = "预付定金时间")
	private Date advance_money_time;
	

	//网络咨询师
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "network_counselor_id",referencedColumnName = "counselor_id")
	@PoiHandler(excelHeader = "网络咨询师",excelIgnore = true)
	private Counselor network_counselor;
	
	//咨询师
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "counselor_id",referencedColumnName = "counselor_id")
	@PoiHandler(excelHeader = "咨询师",excelIgnore = true)
	private Counselor counselor;
	
	public Student() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	public Student(String sid, String sname, Integer age, String sex, String phone, String education_background,
			String status, String source_way, String source_keyword, String address, String qq, String weixin,
			String remark, Date create_time, String course_direction, String is_return_visit,
			Date first_return_visit_time, String is_visit, Date visit_time, String is_payment, Date payment_time,
			Double payment_amount, String is_return_money, String consultant_remark, String stattention,
			String entering_people_name, String return_money_reason, Double advance_money, Date advance_money_time) {
		super();
		this.sid = sid;
		this.sname = sname;
		this.age = age;
		this.sex = sex;
		this.phone = phone;
		this.education_background = education_background;
		this.status = status;
		this.source_way = source_way;
		this.source_keyword = source_keyword;
		this.address = address;
		this.qq = qq;
		this.weixin = weixin;
		this.remark = remark;
		this.create_time = create_time;
		this.course_direction = course_direction;
		this.is_return_visit = is_return_visit;
		this.first_return_visit_time = first_return_visit_time;
		this.is_visit = is_visit;
		this.visit_time = visit_time;
		this.is_payment = is_payment;
		this.payment_time = payment_time;
		this.payment_amount = payment_amount;
		this.is_return_money = is_return_money;
		this.consultant_remark = consultant_remark;
		this.stattention = stattention;
		this.entering_people_name = entering_people_name;
		this.return_money_reason = return_money_reason;
		this.advance_money = advance_money;
		this.advance_money_time = advance_money_time;
	}

	public String getSid() {
		return sid;
	}
	public void setSid(String sid) {
		this.sid = sid;
	}
	public String getSname() {
		return sname;
	}
	public void setSname(String sname) {
		this.sname = sname;
	}
	public Integer getAge() {
		return age;
	}
	public void setAge(Integer age) {
		this.age = age;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getEducation_background() {
		return education_background;
	}
	public void setEducation_background(String education_background) {
		this.education_background = education_background;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getSource_way() {
		return source_way;
	}
	public void setSource_way(String source_way) {
		this.source_way = source_way;
	}
	public String getSource_keyword() {
		return source_keyword;
	}
	public void setSource_keyword(String source_keyword) {
		this.source_keyword = source_keyword;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	
	
	public Counselor getNetwork_counselor() {
		return network_counselor;
	}

	public void setNetwork_counselor(Counselor network_counselor) {
		this.network_counselor = network_counselor;
	}

	public Counselor getCounselor() {
		return counselor;
	}
	public void setCounselor(Counselor counselor) {
		this.counselor = counselor;
	}
	public String getQq() {
		return qq;
	}
	public void setQq(String qq) {
		this.qq = qq;
	}
	public String getWeixin() {
		return weixin;
	}
	public void setWeixin(String weixin) {
		this.weixin = weixin;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Date getCreate_time() {
		return create_time;
	}
	public void setCreate_time(Date create_time) {
		this.create_time = create_time;
	}
	public String getCourse_direction() {
		return course_direction;
	}
	public void setCourse_direction(String course_direction) {
		this.course_direction = course_direction;
	}
	public String getIs_return_visit() {
		return is_return_visit;
	}
	public void setIs_return_visit(String is_return_visit) {
		this.is_return_visit = is_return_visit;
	}
	public Date getFirst_return_visit_time() {
		return first_return_visit_time;
	}
	public void setFirst_return_visit_time(Date first_return_visit_time) {
		this.first_return_visit_time = first_return_visit_time;
	}
	public String getIs_visit() {
		return is_visit;
	}
	public void setIs_visit(String is_visit) {
		this.is_visit = is_visit;
	}
	public Date getVisit_time() {
		return visit_time;
	}
	public void setVisit_time(Date visit_time) {
		this.visit_time = visit_time;
	}
	public String getIs_payment() {
		return is_payment;
	}
	public void setIs_payment(String is_payment) {
		this.is_payment = is_payment;
	}
	public Date getPayment_time() {
		return payment_time;
	}
	public void setPayment_time(Date payment_time) {
		this.payment_time = payment_time;
	}
	public Double getPayment_amount() {
		return payment_amount;
	}
	public void setPayment_amount(Double payment_amount) {
		this.payment_amount = payment_amount;
	}
	public String getIs_return_money() {
		return is_return_money;
	}
	public void setIs_return_money(String is_return_money) {
		this.is_return_money = is_return_money;
	}
	public String getConsultant_remark() {
		return consultant_remark;
	}
	public void setConsultant_remark(String consultant_remark) {
		this.consultant_remark = consultant_remark;
	}
	public String getStattention() {
		return stattention;
	}
	public void setStattention(String stattention) {
		this.stattention = stattention;
	}
	public String getEntering_people_name() {
		return entering_people_name;
	}
	public void setEntering_people_name(String entering_people_name) {
		this.entering_people_name = entering_people_name;
	}
	public String getReturn_money_reason() {
		return return_money_reason;
	}
	public void setReturn_money_reason(String return_money_reason) {
		this.return_money_reason = return_money_reason;
	}
	public Double getAdvance_money() {
		return advance_money;
	}
	public void setAdvance_money(Double advance_money) {
		this.advance_money = advance_money;
	}
	public Date getAdvance_money_time() {
		return advance_money_time;
	}
	public void setAdvance_money_time(Date advance_money_time) {
		this.advance_money_time = advance_money_time;
	}
	@Override
	public String toString() {
		return "Student [sid=" + sid + ", sname=" + sname + ", age=" + age + ", sex=" + sex + ", phone=" + phone
				+ ", education_background=" + education_background + ", status=" + status + ", source_way=" + source_way
				+ ", source_keyword=" + source_keyword + ", address=" + address + ", qq=" + qq + ", weixin=" + weixin
				+ ", remark=" + remark + ", create_time=" + create_time + ", course_direction=" + course_direction
				+ ", is_return_visit=" + is_return_visit + ", first_return_visit_time=" + first_return_visit_time
				+ ", is_visit=" + is_visit + ", visit_time=" + visit_time + ", is_payment=" + is_payment
				+ ", payment_time=" + payment_time + ", payment_amount=" + payment_amount + ", is_return_money="
				+ is_return_money + ", consultant_remark=" + consultant_remark + ", stattention=" + stattention
				+ ", entering_people_name=" + entering_people_name + ", return_money_reason=" + return_money_reason
				+ ", advance_money=" + advance_money + ", advance_money_time=" + advance_money_time + "]";
	}
	
	
}
